﻿using System;
using System.Collections.Generic;
using System.Text;
using EnvDTE;

namespace TSVNAddin.Core
{
	public class ProjectAdapter : ISolutionExplorerItem
	{
		private readonly Project _Project;

		public ProjectAdapter(Project project)
		{
			_Project = project;
		}

		ISolutionExplorerItem ISolutionExplorerItem.GetChildByName(string name)
		{
			foreach (ProjectItem item in _Project.ProjectItems)
			{
				if (item.Name == name)
					return new ProjectItemAdapter(item);
			}

			return null;
		}

		string ISolutionExplorerItem.GetPath()
		{
			return _Project.FullName;
		}
	}
}
